<html>
<head><meta charset="utf-8"><title>vim support · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20support.html">vim support</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="169727167"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20support/near/169727167" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andrew Chin (eminence) <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20support.html#169727167">(Jul 05 2019 at 18:20)</a>:</h4>
<p>Hello all!  I have a question about rust-analyzer with coc.vim.  I've got it setup and working correctly as far as I can see (things like tab completion and go-to definition are working well), but I'm stuck trying to get it to report errors.   Does anyone know if this is supported at the moment, and if so, is any special config needed?</p>



<a name="169727397"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20support/near/169727397" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20support.html#169727397">(Jul 05 2019 at 18:24)</a>:</h4>
<p>We just don't report a ton of errors at the moment: only syntax errors and <em>some</em> semnatic errors, like a missing field in a struct literal</p>



<a name="169727415"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20support/near/169727415" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20support.html#169727415">(Jul 05 2019 at 18:25)</a>:</h4>
<p>the best way to get the full set of errors is using <code>cargo watch</code></p>



<a name="169727493"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20support/near/169727493" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andrew Chin (eminence) <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20support.html#169727493">(Jul 05 2019 at 18:26)</a>:</h4>
<p>ahh, ok.   well that answers my question then.  thanks!</p>



<a name="169727848"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20support/near/169727848" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20support.html#169727848">(Jul 05 2019 at 18:33)</a>:</h4>
<p>Do you get syntax errors though?</p>



<a name="169728074"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20support/near/169728074" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andrew Chin (eminence) <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20support.html#169728074">(Jul 05 2019 at 18:37)</a>:</h4>
<p>no, i didn't seem to get those either</p>



<a name="169728264"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20support/near/169728264" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andrew Chin (eminence) <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20support.html#169728264">(Jul 05 2019 at 18:40)</a>:</h4>
<p>hmm, well now that i try it again, i do see syntax errors reported</p>



<a name="169728356"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20support/near/169728356" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andrew Chin (eminence) <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20support.html#169728356">(Jul 05 2019 at 18:42)</a>:</h4>
<p>and i confirm that i do see errors on missing struct fields.</p>



<a name="169728363"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20support/near/169728363" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andrew Chin (eminence) <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20support.html#169728363">(Jul 05 2019 at 18:43)</a>:</h4>
<p>so it seems like it's all working correctly</p>



<a name="169728469"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20support/near/169728469" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andrew Chin (eminence) <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20support.html#169728469">(Jul 05 2019 at 18:44)</a>:</h4>
<p>this is pretty cool!</p>



<a name="170502717"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20support/near/170502717" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ihor Antonov <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20support.html#170502717">(Jul 10 2019 at 00:41)</a>:</h4>
<p>Hi guys, I am trying to look into <a href="https://github.com/autozimu/LanguageClient-neovim/issues/848" target="_blank" title="https://github.com/autozimu/LanguageClient-neovim/issues/848">https://github.com/autozimu/LanguageClient-neovim/issues/848</a> but the first problem I encountered is that I don't know how to setup all the moving bits and pieces together for productive debugging. Let me explain a bit : it is a complicated setup of editor (nvim), language client plugin, and language server. Problems can potentially happen in any of the three main components. It is not clear for me what is the most effective way of monitoring the communication between server and client? Does anybody have experience of setting dev environment for fast and efficient dev-test cycles with rust analyzer?  Any advice, even most general, is appreciated!</p>



<a name="170523454"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20support/near/170523454" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20support.html#170523454">(Jul 10 2019 at 08:52)</a>:</h4>
<p>For VS Code, the thing that really helps is client-side logging. VS Code shows the trace of all LSP messages, as well as any additional stderr from the server</p>



<a name="170523500"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20support/near/170523500" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20support.html#170523500">(Jul 10 2019 at 08:52)</a>:</h4>
<p>I think setting up something like this for VIM would be wise</p>



<a name="170569135"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20support/near/170569135" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ihor Antonov <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20support.html#170569135">(Jul 10 2019 at 18:56)</a>:</h4>
<p><span class="user-mention" data-user-id="133169">@matklad</span> </p>
<blockquote>
<p>We just don't report a ton of errors at the moment: only syntax errors and <em>some</em> semantic errors, like a missing field in a struct literal</p>
</blockquote>
<p>I have noticed that RLS reports a lot of errors (I'd say everything that cargo shows). Is that because RLS has cargo "embedded"? For obvious reasons running cargo watch on the side is not super convenient. Is there a plan for <em>ra</em> to report all errors and what is the planned architecture?</p>



<a name="170687462"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20support/near/170687462" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> qmx <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20support.html#170687462">(Jul 12 2019 at 01:43)</a>:</h4>
<blockquote>
<p>Hello all!  I have a question about rust-analyzer with coc.vim.  I've got it setup and working correctly as far as I can see (things like tab completion and go-to definition are working well), but I'm stuck trying to get it to report errors.   Does anyone know if this is supported at the moment, and if so, is any special config needed?</p>
</blockquote>
<p>do you get a freeze and further 30s timeout after using jump to definition?</p>



<a name="170687521"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20support/near/170687521" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> qmx <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20support.html#170687521">(Jul 12 2019 at 01:45)</a>:</h4>
<p><span class="user-mention" data-user-id="133169">@matklad</span> what's the policy for things like vim-integration problems? Should we file gh issues too? Just discuss them here?</p>



<a name="170700889"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20support/near/170700889" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20support.html#170700889">(Jul 12 2019 at 07:23)</a>:</h4>
<p>It probably makes sense to file issues, yeah. Looking into the problems would also help ;) Neither me nor Florian are using vim :(</p>



<a name="170700983"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20support/near/170700983" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20support.html#170700983">(Jul 12 2019 at 07:25)</a>:</h4>
<blockquote>
<p>For obvious reasons running cargo watch on the side is not super convenient. Is there a plan for ra to report all errors and what is the planned architecture?</p>
</blockquote>
<p><span class="user-mention" data-user-id="222587">@Ihor Antonov</span>  For starters, we plan to just run <code>cargo watch</code>: that's simple and is actually faster than RLS. Currently this is implemented in VS Code on the client side. We plan to move <code>cargo watch</code> management to the language server</p>



<a name="170713929"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20support/near/170713929" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ihor Antonov <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20support.html#170713929">(Jul 12 2019 at 11:21)</a>:</h4>
<p><span class="user-mention" data-user-id="133169">@matklad</span> </p>
<blockquote>
<blockquote>
<p>For obvious reasons running cargo watch on the side is not super convenient. Is there a plan for ra to report all errors and what is the planned architecture?</p>
</blockquote>
<p><span class="user-mention silent" data-user-id="222587">Ihor Antonov</span>  For starters, we plan to just run <code>cargo watch</code>: that's simple and is actually faster than RLS. Currently this is implemented in VS Code on the client side. We plan to move <code>cargo watch</code> management to the language server</p>
</blockquote>
<p>So does this mean that RA will run <code>cargo watch</code> as a child process and then bubble up errors to the editor in form of LSP diagnostics?</p>



<a name="170714000"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20support/near/170714000" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20support.html#170714000">(Jul 12 2019 at 11:22)</a>:</h4>
<p>More or less yes. Most likely though, we will be calling <code>cargo</code> as a subprocess, not <code>cargo watch</code>, and that we might also ask it to produce save-analysis data, in addition to just diagnostics</p>



<a name="170714041"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20support/near/170714041" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20support.html#170714041">(Jul 12 2019 at 11:23)</a>:</h4>
<p>to clarify, the end game here is absolutely to just produce all errors on the fly from withing rust-analyze itself, using a salsa-based incremental compiler. We are very far from that at the moment though, so leveraging <code>cargo check</code> seems like a good idea in the meantime</p>



<a name="170714755"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20support/near/170714755" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ihor Antonov <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20support.html#170714755">(Jul 12 2019 at 11:37)</a>:</h4>
<p>I agree and I like it, it follows Unix philosophy</p>



<a name="170714759"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20support/near/170714759" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Ihor Antonov <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20support.html#170714759">(Jul 12 2019 at 11:37)</a>:</h4>
<p>Thanks for the clarifications</p>



<a name="173456492"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20support/near/173456492" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20support.html#173456492">(Aug 17 2019 at 20:09)</a>:</h4>
<p>I'm having some trouble figuring out how to enable cargo watch integration with rust-analyzer. This is already available right? I'm using coc.nvim and tried</p>
<p>```{<br>
    "languageserver": {<br>
        "rust": {<br>
            "command": "ra_lsp_server",<br>
            "filetypes": ["rust"],<br>
            "rootPatterns": ["Cargo.toml"]<br>
        }<br>
    },<br>
    "rust-analyzer.enableCargoWatchOnStartup": "ask"<br>
}</p>
<div class="codehilite"><pre><span></span>
</pre></div>



<a name="173456504"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20support/near/173456504" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20support.html#173456504">(Aug 17 2019 at 20:09)</a>:</h4>
<p>but nothing seems to happen, I've tried using vscode and it will give me a prompt to enable cargo watch, but after clicking yes nothing visibly happens</p>



<a name="173456547"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20support/near/173456547" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20support.html#173456547">(Aug 17 2019 at 20:10)</a>:</h4>
<p>running cargo watch independently seems to work well</p>



<a name="173457159"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20support/near/173457159" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20support.html#173457159">(Aug 17 2019 at 20:27)</a>:</h4>
<p>I've also tried "enabled" instead of "ask"</p>



<a name="173458981"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20support/near/173458981" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Pascal <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20support.html#173458981">(Aug 17 2019 at 21:19)</a>:</h4>
<p>i think the settings listed on <a href="https://github.com/rust-analyzer/rust-analyzer/blob/2bac1bdf174a053f0727e982f0f92d068ef3c208/docs/user/README.md#settings" target="_blank" title="https://github.com/rust-analyzer/rust-analyzer/blob/2bac1bdf174a053f0727e982f0f92d068ef3c208/docs/user/README.md#settings">https://github.com/rust-analyzer/rust-analyzer/blob/2bac1bdf174a053f0727e982f0f92d068ef3c208/docs/user/README.md#settings</a> are only for the vscode ext. from what i can tell cargo-watch run completely separate to ra_lsp_server</p>



<a name="173459472"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20support/near/173459472" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20support.html#173459472">(Aug 17 2019 at 21:35)</a>:</h4>
<p>Ooh, sad face</p>



<a name="173494012"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20support/near/173494012" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Pascal <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20support.html#173494012">(Aug 18 2019 at 16:57)</a>:</h4>
<p>maybe you can make a cargo-watch vim extension based on this impl? <a href="https://github.com/rust-analyzer/rust-analyzer/tree/2bac1bdf174a053f0727e982f0f92d068ef3c208/editors/code/src/utils/diagnostics" target="_blank" title="https://github.com/rust-analyzer/rust-analyzer/tree/2bac1bdf174a053f0727e982f0f92d068ef3c208/editors/code/src/utils/diagnostics">https://github.com/rust-analyzer/rust-analyzer/tree/2bac1bdf174a053f0727e982f0f92d068ef3c208/editors/code/src/utils/diagnostics</a></p>



<a name="173563738"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20support/near/173563738" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20support.html#173563738">(Aug 19 2019 at 17:47)</a>:</h4>
<p>I was going to set up ale-vim to just run cargo for me on save because that composes well with coc.nvim + rust-analyzer</p>



<a name="173563830"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20support/near/173563830" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jane Lusby <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20support.html#173563830">(Aug 19 2019 at 17:48)</a>:</h4>
<p>a vim extension for cargo watch would eventually be deprecated anyways right? My understanding is that ra-lsp will eventually have an incremental compiler built in</p>



<a name="193402845"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20support/near/193402845" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simlay <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20support.html#193402845">(Apr 09 2020 at 03:13)</a>:</h4>
<p>Anyone know how to make <a href="https://github.com/autozimu/LanguageClient-neovim" title="https://github.com/autozimu/LanguageClient-neovim">https://github.com/autozimu/LanguageClient-neovim</a> work with the rust-analyzer.additionalOutDirs key?</p>



<a name="193404079"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20support/near/193404079" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simlay <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20support.html#193404079">(Apr 09 2020 at 03:42)</a>:</h4>
<p>hmm, looks like "rust-analyzer.cargoFeatures.loadOutDirsFromCheck": true</p>



<a name="193404138"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20support/near/193404138" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simlay <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20support.html#193404138">(Apr 09 2020 at 03:43)</a>:</h4>
<p>Well, after reading a bunch of the neovim client's docs, the file to modify is .vim/settings.json in your project directory but you can change that if you want</p>



<a name="193404147"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20support/near/193404147" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simlay <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20support.html#193404147">(Apr 09 2020 at 03:43)</a>:</h4>
<p>You'll need <code>let g:LanguageClient_loadSettings = 1</code> in your vimrc as well.</p>



<a name="193404205"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20support/near/193404205" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simlay <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20support.html#193404205">(Apr 09 2020 at 03:44)</a>:</h4>
<p>My actual goal is to get expansions for the <code>include!(concat!(env!("OUT_DIR"), "/foo.rs"))</code> pattern.</p>



<a name="193404280"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20support/near/193404280" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simlay <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20support.html#193404280">(Apr 09 2020 at 03:46)</a>:</h4>
<p>I can't seem to get that working</p>



<a name="193404321"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20support/near/193404321" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simlay <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20support.html#193404321">(Apr 09 2020 at 03:46)</a>:</h4>
<p>One fear I have is that because I'm targeting x86_64-apple-ios, it doesn't expand</p>



<a name="193413658"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20support/near/193413658" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20support.html#193413658">(Apr 09 2020 at 07:07)</a>:</h4>
<blockquote>
<p>One fear I have is that because I'm targeting x86_64-apple-ios, it doesn't expand</p>
</blockquote>
<p>Hm, interesting! I haven't tried rust-analyzer in cross-compilation scenarios, it <em>might</em> be that you need to pass <code>--target</code> flag somehow, but I am not sure if we can override it in any case</p>



<a name="193413684"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20support/near/193413684" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20support.html#193413684">(Apr 09 2020 at 07:07)</a>:</h4>
<p>I <em>think</em> that for loadOutDirs functionality we are running cargo for host</p>



<a name="193413758"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20support/near/193413758" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20support.html#193413758">(Apr 09 2020 at 07:09)</a>:</h4>
<p>If you happen to feel like diving into the source code, the out dir loading happens here: <a href="https://github.com/rust-analyzer/rust-analyzer/blob/080c983498afcac3eb54028af5c9f8bfe7f2c826/crates/ra_project_model/src/cargo_workspace.rs#L275-L319" title="https://github.com/rust-analyzer/rust-analyzer/blob/080c983498afcac3eb54028af5c9f8bfe7f2c826/crates/ra_project_model/src/cargo_workspace.rs#L275-L319">https://github.com/rust-analyzer/rust-analyzer/blob/080c983498afcac3eb54028af5c9f8bfe7f2c826/crates/ra_project_model/src/cargo_workspace.rs#L275-L319</a></p>



<a name="193489174"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20support/near/193489174" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simlay <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20support.html#193489174">(Apr 09 2020 at 18:17)</a>:</h4>
<p>Yeah, so I've got the default target for this project set in <code>.cargo/config</code> as x86_64-apple-ios. I've verified that this works by doing a <code>cargo clean</code> and then opening vim (which opens rust-analyzer), which then I assume runs <code>cargo check</code> through the <code>load_extern_resources</code> function.</p>



<a name="193501683"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20support/near/193501683" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simlay <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20support.html#193501683">(Apr 09 2020 at 19:59)</a>:</h4>
<p>At which point my version of <code>include!(concat!(env!("OUT_DIR"), "/foo.rs"))</code> is built but I can't seem to jump to definitions in it.</p>



<a name="193508711"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20support/near/193508711" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Edwin Cheng <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20support.html#193508711">(Apr 09 2020 at 21:01)</a>:</h4>
<p>Jump to definitions for include! macro is not implemented yet but completion should works.</p>



<a name="193513189"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/vim%20support/near/193513189" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simlay <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/vim.20support.html#193513189">(Apr 09 2020 at 21:43)</a>:</h4>
<p>ah, that's good to know.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>